package test.com.sms.selenium.singlepoint.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class SpAssetLocationPageUtil extends SeleniumPageUtil {
	////*[@id='form1']/table/tbody/tr[2]/td/div/table/tbody/tr/td[4]
	public final static By ASL_SPAN_HEADER_TITLE  		= By.xpath("//*[@id='form1']/table/tbody/tr[2]/td/div/table/tbody/tr/td[4]");
	public final static By ASL_SPAN_REC_NUM  		= By.id("ctl44_lblNumRecs");
	public final static By ASL_SPAN_SCOPE  		= By.id("ctl44_lblScope");
	public static void enterAssetLocationPage(){
		SpHomePageUtil.enter();
		SeleniumUtil.click(SpHomePageUtil.getMainMenuAssets());
		SeleniumUtil.waitOnElements(new By[]{SpHomePageUtil.HOME_SUB_MENU_AST_LOCATION});
		SeleniumUtil.click(SpHomePageUtil.getAssetsLocation());
		SeleniumUtil.waitForFixedMilliseconds(1000);
		waitForPageToLoad();
	}
	public static void waitForPageToLoad(){
		//asset search page in content area
		SeleniumUtil.selectDefaultContent();
		SeleniumUtil.selectFrame(SpHomePageUtil.HOME_FRAME_CONTENT_NAME);
		SeleniumUtil.waitOnElements(new By[]{
				ASL_SPAN_HEADER_TITLE,ASL_SPAN_REC_NUM,ASL_SPAN_SCOPE
			});
	}
}
